import request from '@/utils/request'

//获取轮播图位置下拉框
export const bannerAddrSelections = ()=> {
    // return request.get('/')
    return Promise.resolve({
        list: [
            {label: '全部', value: ''},
            {label: '首页', value: '1'},
            {label: '活动1', value: '2'},
            {label: '活动2', value: '3'},
            {label: '活动3', value: '4'},
        ]
    })
}

/**
 * 获取轮播图列表
 * @param addr - 轮播图位置
 * @param page - 页码
 * @param pageSize - 分页大小
 */
export const apiBanners = (addr, page, pageSize) => {
    // return request.get('/', {
    //     params: {
    //         page: page | 1,
    //         pageSize: pageSize | 10,
    //         addr: addr | ''
    //     }
    // })
    return Promise.resolve({
        list: [
            {id: 1, img: 'http://gips2.baidu.com/it/u=195724436,3554684702&fm=3028&app=3028&f=JPEG&fmt=auto?w=1280&h=960', sort: 1, createTime: '2024-05-29 14:25:00', addr: '首页', url: '/goods/detail?id=2'},
            {id: 2, img: 'http://gips2.baidu.com/it/u=195724436,3554684702&fm=3028&app=3028&f=JPEG&fmt=auto?w=1280&h=960', sort: 1, createTime: '2024-05-29 14:25:00', addr: '首页', url: '/goods/detail?id=2'},
            {id: 3, img: 'http://gips2.baidu.com/it/u=195724436,3554684702&fm=3028&app=3028&f=JPEG&fmt=auto?w=1280&h=960', sort: 1, createTime: '2024-05-29 14:25:00', addr: '首页', url: '/goods/detail?id=2'},
            {id: 4, img: 'http://gips2.baidu.com/it/u=195724436,3554684702&fm=3028&app=3028&f=JPEG&fmt=auto?w=1280&h=960', sort: 1, createTime: '2024-05-29 14:25:00', addr: '首页', url: '/goods/detail?id=2'},
            {id: 5, img: 'http://gips2.baidu.com/it/u=195724436,3554684702&fm=3028&app=3028&f=JPEG&fmt=auto?w=1280&h=960', sort: 1, createTime: '2024-05-29 14:25:00', addr: '首页', url: '/goods/detail?id=2'},
            {id: 6, img: 'http://gips2.baidu.com/it/u=195724436,3554684702&fm=3028&app=3028&f=JPEG&fmt=auto?w=1280&h=960', sort: 1, createTime: '2024-05-29 14:25:00', addr: '首页', url: '/goods/detail?id=2'},
            {id: 7, img: 'http://gips2.baidu.com/it/u=195724436,3554684702&fm=3028&app=3028&f=JPEG&fmt=auto?w=1280&h=960', sort: 1, createTime: '2024-05-29 14:25:00', addr: '首页', url: '/goods/detail?id=2'},
            {id: 8, img: 'http://gips2.baidu.com/it/u=195724436,3554684702&fm=3028&app=3028&f=JPEG&fmt=auto?w=1280&h=960', sort: 1, createTime: '2024-05-29 14:25:00', addr: '首页', url: '/goods/detail?id=2'},
            {id: 9, img: 'http://gips2.baidu.com/it/u=195724436,3554684702&fm=3028&app=3028&f=JPEG&fmt=auto?w=1280&h=960', sort: 1, createTime: '2024-05-29 14:25:00', addr: '首页', url: '/goods/detail?id=2'},
            {id: 10, img: 'http://gips2.baidu.com/it/u=195724436,3554684702&fm=3028&app=3028&f=JPEG&fmt=auto?w=1280&h=960', sort: 1, createTime: '2024-05-29 14:25:00', addr: '首页', url: '/goods/detail?id=2'},
            {id: 11, img: 'http://gips2.baidu.com/it/u=195724436,3554684702&fm=3028&app=3028&f=JPEG&fmt=auto?w=1280&h=960', sort: 1, createTime: '2024-05-29 14:25:00', addr: '首页', url: '/goods/detail?id=2'},
        ],
        total: 11
    })
}

/**
 * 删除轮播图
 * @param id - 轮播图id
 */
export const apiDelbanner = id => {
    // return request.post('/', {id})
    return Promise.resolve({
        data: '',
        msg: '删除成功!'
    })
}
